'****************************************************************************'
'                                                                            '
' Copyright (C) 2010 Muhammad alaa                                           '
'                                                                            '
' This program is free software; you can redistribute it and/or modify       '
' it under the terms of the GNU General Public License as published by       '
' the Free Software Foundation; either version 2 of the License, or          '
' (at your option) any later version.                                        '
'                                                                            '
' This program is distributed in the hope that it will be useful,            '
' but WITHOUT ANY WARRANTY; without even the implied warranty of             '
' MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the              '
' GNU General Public License for more details.                               '
'                                                                            '
' You should have received a copy of the GNU General Public License along    '
' with this program; if not, write to the Free Software Foundation, Inc.,    '
' 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.                '
'                                                                            '
'****************************************************************************'

Public Structure BindOptions
    Public cbStruct As UInteger
    Public grfFlags As BindFlags
    Public grfMode As UInteger
    Public dwTickCountDeadline As UInteger
End Structure

Public Structure BindOptions2
    Public cbStruct As UInteger
    Public grfFlags As BindFlags
    Public grfMode As UInteger
    Public dwTickCountDeadline As UInteger
    Public dwTrackFlags As UInteger
    Public dwClassContext As ClsCtx
    Public locale As UInteger
    Public pServerInfo As CoServerInfo
End Structure

Public Structure CoServerInfo
    Public dwReserved1 As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pwszName As String
    Public pAuthInfo As CoAuthInfo
    Public dwReserved2 As UInteger
End Structure

Public Structure CoAuthInfo
    Public dwAuthnSvc As UInteger
    Public dwAuthzSvc As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public pwszServerPrincName As String
    Public dwAuthnLevel As UInteger
    Public dwImpersonationLevel As UInteger
    Public pAuthIdentityData As CoAuthIdentity
    Public dwCapabilities As UInteger
End Structure

Public Structure CoAuthIdentity
    Public User As IntPtr
    Public UserLength As UInteger
    Public Domain As UShort
    Public DomainLength As UInteger
    Public Password As IntPtr
    Public PasswordLength As UInteger
    Public Flags As AuthIdentity
End Structure

Public Structure BindOptions3
    Public cbStruct As UInteger
    Public grfFlags As BindFlags
    Public grfMode As UInteger
    Public dwTickCountDeadline As UInteger
    Public dwTrackFlags As UInteger
    Public dwClassContext As ClsCtx
    Public locale As UInteger
    Public pServerInfo As CoServerInfo
    Public hWnd As IntPtr
End Structure

Public Structure CallFrameMarshalContext
    <MarshalAs(UnmanagedType.Bool)> _
    Public fIn As Boolean
    Public dwDestContext As UInteger
    Public pvDestContext As IntPtr
    Public mshlmgr As IntPtr
    Public guidTransferSyntax As Guid
End Structure

Public Structure CallFrameInfo
    Public iMethod As UInteger
    <MarshalAs(UnmanagedType.Bool)> _
    Public fHasInValues As Boolean
    <MarshalAs(UnmanagedType.Bool)> _
    Public fHasInOutValues As Boolean
    <MarshalAs(UnmanagedType.Bool)> _
    Public fHasOutValues As Boolean
    <MarshalAs(UnmanagedType.Bool)> _
    Public fDerivesFromIDispatch As Boolean
    Public cInInterfacesMax As UInteger
    Public cInOutInterfacesMax As UInteger
    Public cOutInterfacesMax As UInteger
    Public cTopLevelInInterfaces As UInteger
    Public iid As Guid
    Public cMethod As UInteger
    Public cParams As UInteger
End Structure

Public Structure CallFrameParamInfo
    <MarshalAs(UnmanagedType.Bool)> _
    Public fIn As Boolean
    <MarshalAs(UnmanagedType.Bool)> _
    Public fOut As Boolean
    Public stackOffset As UInteger
    Public cbParam As UInteger
End Structure

Public Structure CategoryInfo
    Public catID As UInteger
    Public lcid As UInteger
    <MarshalAs(UnmanagedType.LPWStr, SizeConst:=128)> _
    Public szDescription As String
End Structure

Public Structure ContectData
    <MarshalAs(UnmanagedType.Interface)> _
    Public pUnk As Object
    Public dwCookie As UInteger
End Structure

Public Structure CsPlatform
    Public dwPlatformId As UInteger
    Public dwVersionHi As UInteger
    Public dwVersionLo As UInteger
    Public dwProcessorArch As UInteger
End Structure

Public Structure InterfaceInfo
    <MarshalAs(UnmanagedType.Interface)> _
    Public pUnk As Object
    Public iid As GUID
    Public wMethod As UShort
End Structure

Public Structure MultiQI
    Public iid As Guid
    <MarshalAs(UnmanagedType.Interface)> _
    Public pItf As Object
    Public hr As HResult
End Structure

Public Structure QueryContext
    Public dwContext As ClsCtx
    Public Platform As CsPlatform
    Public Locale As UInteger
    Public dwVersionHi As UInteger
    Public dwVersionLo As UInteger
End Structure

Public Structure RpcOleMessage
    Public reserved1 As IntPtr
    Public dataRepresentation As UInteger
    Public Buffer As IntPtr
    Public cbBuffer As UInteger
    Public iMethod As UInteger
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=5)> _
    Public reserved2() As IntPtr
    Public rpcFlags As UInteger
End Structure

Public Structure SoleAuthenticationInfo
    Public dwAuthnSvc As UInteger
    Public dwAuthzSvc As UInteger
    Public pAuthInfo As IntPtr
End Structure

Public Structure SoleAuthenticationList
    Public cAuthInfo As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public aAuthInfo() As SoleAuthenticationInfo
End Structure

Public Structure SoleAuthenticationService
    Public dwAuthnSvc As UInteger
    Public dwAuthzSvc As UInteger
    Public pPrincipalName As IntPtr
    Public hr As HResult
End Structure

Public Structure SOleTlsData
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=2)> _
    Public pvReserved0() As IntPtr
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=3)> _
    Public dwReserved0 As UInteger
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=1)> _
    Public pvReserved1() As IntPtr
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=3)> _
    Public dwReserved1 As UInteger
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=4)> _
    Public pvReserved2() As IntPtr
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=1)> _
    Public dwReserved2 As UInteger
    Public pCurrentCtx As IntPtr
End Structure

Public Structure ActrlAccess
    Public cEntries As UInteger
    Public pPropertyAccessList As IntPtr
End Structure

Public Structure ActrlAccessEntry
    Public Trustee As Trustee
    Public fAccessFlags As ActrlAccessFlags
    Public Access As UInteger
    Public ProvSpecificAccess As UInteger
    Public Inheritance As UInteger
    <MarshalAs(UnmanagedType.LPTStr)> _
    Public lpInheritProperty As String
End Structure

Public Structure ActrlAccessEntryList
    Public cEntries As UInteger
    Public pAccessList As IntPtr
End Structure

Public Structure ActrlPropertyEntry
    <MarshalAs(UnmanagedType.LPTStr)> _
    Public lpProperty As String
    Public pAccessEntryList As ActrlAccessEntryList
    Public fListFlags As UInteger

End Structure

Public Structure Trustee
    Public MultipleTrustee As IntPtr
    Public MultipleTrusteeOperation As MultipleTrusteeOperation
    Public TrusteeForm As TrusteeForm
    Public TrusteeType As TrusteeType
    Public ptstrName As IntPtr
End Structure

<StructLayout(LayoutKind.Explicit)> _
Public Structure FileTime
    <FieldOffset(0)> _
    Public dwLowDateTime As UInteger
    <FieldOffset(4)> _
    Public dwHighDateTime As UInteger
    <FieldOffset(0)> _
    Public DateTime As ULong
End Structure

Public Structure LicInfo
    Public cbLicInfo As Integer
    <MarshalAs(UnmanagedType.Bool)> _
    Public fRuntimeKeyAvail As Boolean
    <MarshalAs(UnmanagedType.Bool)> _
    Public fLicVerified As Boolean
End Structure

Public Structure ComCallData
    Public dwDispid As UInteger
    Public dwReserved As UInteger
    Public pUserDefined As IntPtr
End Structure

Public Structure ConnectData
    <MarshalAs(UnmanagedType.Interface)> _
    Public pUnk As Object
    Public dwCookie As Integer
End Structure

Public Structure ContextProperty
    Public policyId As Guid
    Public flags As UInteger
    <MarshalAs(UnmanagedType.Interface)> _
    Public pUnk As Object
End Structure

Public Structure Blob
    Public cbSize As UInteger
    <MarshalAs(UnmanagedType.LPArray, ArraySubType:=UnmanagedType.U1)> _
    Public pBlobData() As Byte
End Structure

Public Structure ACL
    Public AclRevision As Byte
    Public Sbz1 As Byte
    Public AclSize As UShort
    Public AceCount As UShort
    Public Sbz2 As UShort
End Structure

Public Structure SecurityDescriptor
    Public Revision As Byte
    Public Size As Byte
    Public Control As UShort
    Public Owner As IntPtr
    Public Group As IntPtr
    Public Sacl As ACL
    Public Dacl As ACL
End Structure

Public Structure Point
    Public X As Integer
    Public Y As Integer
End Structure

Public Structure Msg
    Public hWnd As IntPtr
    Public Message As UInteger
    Public wParam As IntPtr
    Public lParam As IntPtr
    Public time As UInteger
    Public pt As Point
End Structure

Public Structure DVAspectInfo
    Public cb As UInteger
    Public dwFlags As DVAspectInfoFlag
End Structure

Public Structure Size
    Public cX As Integer
    Public cY As Integer
End Structure

Public Structure DVExtentInfo
    Public cb As UInteger
    Public dwExtentMode As DVExtentMode
    Public sizelProposed As Size
End Structure

Public Structure DVTargetDevice
    Public tdSize As UInteger
    Public tdDriverNameOffset As UShort
    Public tdDeviceNameOffset As UShort
    Public tdPortNameOffset As UShort
    Public tdExtDevmodeOffset As UShort
    Public tdData As IntPtr
End Structure

Public Structure FormatETC
    Public cfFormat As ClipFormat
    Public ptd As DVTargetDevice
    Public dwAspect As DVAspect
    Public lindex As Integer
    Public tymed As TyMed
End Structure

Public Structure ObjectDescriptor
    Public cbSize As UInteger
    Public clsid As Guid
    Public dwDrawAspect As DVAspect
    Public sizel As Size
    Public pointl As Point
    Public dwStatus As OleMisc
    Public dwFullUserTypeName As UInteger
    Public dwSrcOfCopy As UInteger
End Structure

Public Structure OleCmd
    Public cmdID As OleCmdID
    Public cmdf As OleCmdF
End Structure

Public Structure OleCmdText
    Public cmdtextf As OleCmdTextF
    Public cwActual As UInteger
    Public cwBuf As UInteger
    Public rgwz As IntPtr
End Structure

Public Structure OleInPlaceFrameInfo
    Public cb As UInteger
    <MarshalAs(UnmanagedType.Bool)> _
    Public fMDIApp As Boolean
    Public hWndFrame As IntPtr
    Public haccel As IntPtr
    Public cAccelEntries As UInteger
End Structure

Public Structure OleMenuGroupWidths
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=6)> _
    Public width() As Integer
End Structure

Public Structure OleUIBusyA
    Public cbStruct As UInteger
    Public dwFlags As OleUIBusyFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public hTask As IntPtr
    Public lphWndDialog As IntPtr
End Structure

Public Structure OleUIBusyW
    Public cbStruct As UInteger
    Public dwFlags As OleUIBusyFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public hTask As IntPtr
    Public lphWndDialog As IntPtr
End Structure

Public Structure OleUIChangeIconA
    Public cbStruct As UInteger
    Public dwFlags As ChangeIconFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public hMetaPict As IntPtr
    Public clsid As Guid
    <MarshalAs(UnmanagedType.LPStr, SizeConst:=260)> _
    Public szIconExe As String
    Public cchIconExe As Integer
End Structure

Public Structure OleUIChangeIconW
    Public cbStruct As UInteger
    Public dwFlags As ChangeIconFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public hMetaPict As IntPtr
    Public clsid As Guid
    <MarshalAs(UnmanagedType.LPWStr, SizeConst:=260)> _
    Public szIconExe As String
    Public cchIconExe As Integer
End Structure

Public Structure OleUIChangeSourceA
    Public cbStruct As UInteger
    Public dwFlags As ChangeSourceDialogFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public lpOFN As OpenFileNameA
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=4)> _
    Public dwReserved1() As UInteger
    Public lpOleUILinkContainer As IOLE.IOleUILinkContainer
    Public dwLink As UInteger
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszDisplayName As String
    Public nFileLength As UInteger
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszFrom As String
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTo As String
End Structure

Public Structure OleUIChangeSourceW
    Public cbStruct As UInteger
    Public dwFlags As ChangeSourceDialogFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public lpOFN As OpenFileNameW
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=4)> _
    Public dwReserved1() As UInteger
    Public lpOleUILinkContainer As IOLE.IOleUILinkContainer
    Public dwLink As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszDisplayName As String
    Public nFileLength As UInteger
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszFrom As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTo As String
End Structure

Public Structure OleUIConvertA
    Public cbStruct As UInteger
    Public dwFlags As ConvertDialogFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public clsid As Guid
    Public clsidConvertDefault As Guid
    Public clsidActivateDefault As Guid
    Public clsidNew As Guid
    Public dvAspect As DVAspect
    Public wFormat As UShort
    <MarshalAs(UnmanagedType.Bool)> _
    Public fIsLinkedObject As Boolean
    Public hMetaPict As MetaFilePict
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszUserType As String
    <MarshalAs(UnmanagedType.Bool)> _
    Public fObjectsIconChanged As Boolean
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszDefLabel As String
    Public cClsidExclude As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public lpClsidExclude() As Guid
End Structure

Public Structure OleUIConvertW
    Public cbStruct As UInteger
    Public dwFlags As ConvertDialogFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public clsid As Guid
    Public clsidConvertDefault As Guid
    Public clsidActivateDefault As Guid
    Public clsidNew As Guid
    Public dvAspect As DVAspect
    Public wFormat As UShort
    <MarshalAs(UnmanagedType.Bool)> _
    Public fIsLinkedObject As Boolean
    Public hMetaPict As MetaFilePict
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszUserType As String
    <MarshalAs(UnmanagedType.Bool)> _
    Public fObjectsIconChanged As Boolean
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszDefLabel As String
    Public cClsidExclude As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public lpClsidExclude() As Guid
End Structure

Public Structure OleUIEditLinksA
    Public cbStruct As UInteger
    Public dwFlags As EditLinksFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public lpOleUILinkContainer As IOLE.IOleUILinkContainer
End Structure

Public Structure OleUIEditLinksW
    Public cbStruct As UInteger
    Public dwFlags As EditLinksFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public lpOleUILinkContainer As IOLE.IOleUILinkContainer
End Structure

Public Structure OleUIGnrlProps
    Public cbStruct As UInteger
    Public dwFlags As UInteger
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=2)> _
    Public dwReserved1() As UInteger
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=3)> _
    Public dwReserved2() As UInteger
    Public lpOP As IntPtr
End Structure

Public Structure OleUIInsertObjectA
    Public cbStruct As UInteger
    Public dwFlags As InsertObjectFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public clsid As Guid
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszFile As String
    Public cchFile As UInteger
    Public cClsidExclude As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public lpClsidExclude() As Guid
    Public iid As Guid
    Public oleRender As UInteger
    Public lpFormatEtc As FormatETC
    Public lpIOleClientSite As IOLE.IOleClientSite
    Public lpIStorage As OLE.IStorage
    <MarshalAs(UnmanagedType.IUnknown)> _
    Public ppvObj As IntPtr
    Public sc As UInteger
    Public hMetaPict As MetaFilePict
End Structure

Public Structure OleUIInsertObjectW
    Public cbStruct As UInteger
    Public dwFlags As InsertObjectFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public clsid As Guid
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszFile As String
    Public cchFile As UInteger
    Public cClsidExclude As UInteger
    <MarshalAs(UnmanagedType.LPArray)> _
    Public lpClsidExclude() As Guid
    Public iid As Guid
    Public oleRender As UInteger
    Public lpFormatEtc As FormatETC
    Public lpIOleClientSite As IOLE.IOleClientSite
    Public lpIStorage As OLE.IStorage
    <MarshalAs(UnmanagedType.IUnknown)> _
    Public ppvObj As IntPtr
    Public sc As UInteger
    Public hMetaPict As MetaFilePict
End Structure

Public Structure OleUILinkProps
    Public cbStruct As UInteger
    Public dwFlags As UInteger
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=2)> _
    Public dwReserved1() As UInteger
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=3)> _
    Public dwReserved2() As UInteger
    Public lpOP As IntPtr
End Structure

Public Structure OleUIObjectProps
    Public cbStruct As UInteger
    Public dwFlags As ObjectPropsFlags
    Public lpPS As PropertySheetHeader
    Public dwObject As UInteger
    Public lpObjInfo As IntPtr
    Public dwLink As UInteger
    Public lpLinkInfo As IntPtr
    Public lpGP As OleUIGnrlProps
    Public lpVP As OleUIViewProps
    Public lpLP As OleUILinkProps
End Structure

Public Structure OleUIPasteEntryA
    Public fmtetc As FormatETC
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpstrFormatName As String
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpstrResultText As String
    Public dwFlags As OleUIPasteFlag
    Public dwScratchSpace As UInteger
End Structure

Public Structure OleUIPasteEntryW
    Public fmtetc As FormatETC
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpstrFormatName As String
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpstrResultText As String
    Public dwFlags As OleUIPasteFlag
    Public dwScratchSpace As UInteger
End Structure

Public Structure OleUIPasteSpecialA
    Public cbStruct As UInteger
    Public dwFlags As PasteSpecialFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public lpSrcDataObj As IOLE.IDataObject
    Public arrPasteEntries As OleUIPasteEntryA
    Public cPasteEntries As Integer
    <MarshalAs(UnmanagedType.LPArray)> _
    Public arrLinkTypes() As OleUIPasteFlag
    Public cLinkTypes As Integer
    <MarshalAs(UnmanagedType.LPArray)> _
    Public cClsidExclude() As UInteger
    Public lpClsidExclude As Guid
    Public nSelectedIndex As Integer
    <MarshalAs(UnmanagedType.Bool)> _
    Public fLink As Boolean
    Public hMetaPict As MetaFilePict
    Public sizel As Size
End Structure

Public Structure OleUIPasteSpecialW
    Public cbStruct As UInteger
    Public dwFlags As PasteSpecialFlags
    Public hWndOwner As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszCaption As String
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    Public hInstance As IntPtr
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszTemplate As String
    Public hResource As IntPtr
    Public lpSrcDataObj As IOLE.IDataObject
    Public arrPasteEntries As OleUIPasteEntryW
    Public cPasteEntries As Integer
    <MarshalAs(UnmanagedType.LPArray)> _
    Public arrLinkTypes() As OleUIPasteFlag
    Public cLinkTypes As Integer
    <MarshalAs(UnmanagedType.LPArray)> _
    Public cClsidExclude() As UInteger
    Public lpClsidExclude As Guid
    Public nSelectedIndex As Integer
    <MarshalAs(UnmanagedType.Bool)> _
    Public fLink As Boolean
    Public hMetaPict As MetaFilePict
    Public sizel As Size
End Structure

Public Structure OleUIViewProps
    Public cbStruct As UInteger
    Public dwFlags As ViewPropsFlags
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=2)> _
    Public dwReserved1() As UInteger
    Public lpfnHook As OleUIHookDelegate
    Public lCustData As IntPtr
    <MarshalAs(UnmanagedType.LPArray, SizeConst:=3)> _
    Public dwReserved2() As UInteger
    Public lpOP As IntPtr
    Public nScaleMin As Integer
    Public nScaleMax As Integer
End Structure

Public Structure OleVerb
    Public lVerb As Integer
    <MarshalAs(UnmanagedType.LPWStr)> _
    Public lpszVerbName As String
    Public fuFlags As UInteger
    Public grfAttribs As OleVerbAttrib
End Structure

Public Structure StatData
    Public formatetc As FormatETC
    Public advf As AdvF
    Public pAdvSink As IOLE.IAdviseSink
    Public dwConnection As UInteger
End Structure

Public Structure StgMedium
    Public TYMED As TyMed
    Public pData As IntPtr
    <MarshalAs(UnmanagedType.IUnknown)> _
    Public pUnkForRelease As Object
End Structure

Public Structure PropertySheetHeader
    Public dwSize As UInteger
    Public dwFlags As PropertySheetFlags
    Public hwndParent As IntPtr
    Public hInstance As IntPtr
    Public Icon As IntPtr ' used instead union
    <MarshalAs(UnmanagedType.LPTStr)> _
    Public pszCaption As String
    Public nPages As UInteger
    Public StartPage As IntPtr
    Public Page As IntPtr
    Public pfnCallback As PropertySheetCallbackDelegate
    Public Watermark As IntPtr
    Public hplWatermark As IntPtr
    Public bmHeader As IntPtr
End Structure